package com.warmlight.voicepacket.utils;

import com.warmlight.voicepacket.http.Callback;
import com.warmlight.voicepacket.http.HttpClient;
import com.warmlight.voicepacket.http.HttpConfig;

import java.io.IOException;
import java.util.TreeMap;

import okhttp3.Call;

public class ClickLog {

    public static final String bag_all_rec = "bag_all_rec";
    public static final String dis_tab = "dis_tab";
    public static final String dis_bag = "dis_bag";
    public static final String dis_bag_lock = "dis_bag_lock";
    public static final String dis_bag_open = "dis_bag_open";
    public static final String dis_bag_all = "dis_bag_all";
    public static final String dis_voice_play = "dis_voice_play";
    public static final String dis_voice_tag = "dis_voice_tag";
    public static final String dis_voice_oplay = "dis_voice_oplay";
    public static final String dis_voice_otag = "dis_voice_otag";
    public static final String dis_voice_share = "dis_voice_share";
    public static final String dis_voice_clot = "dis_voice_clot";
    public static final String dis_voice_lock = "dis_voice_lock";
    public static final String dis_voice_oshare = "dis_voice_oshare";
    public static final String dis_voice_oclot = "dis_voice_oclot";
    public static final String myclot_feed_play = "myclot_feed_play";
    public static final String myclot_feed_more = "myclot_feed_more";
    public static final String bag_feed_play = "bag_feed_play";
    public static final String bag_feed_share = "bag_feed_share";
    public static final String bag_feed_clot = "bag_feed_clot";
    public static final String float_unfold = "float_unfold";
    public static final String float_fold = "float_fold";
    public static final String float_exp = "float_exp";
    public static final String float_seting = "float_seting";
    public static final String float_clot = "float_clot";
    public static final String float_clot_ = "float_clot";

    public static final String p_bag_feed_play = "p_bag_feed_play";
    public static final String s_bag_feed_play = "s_bag_feed_play";
    public static final String p_bag_feed_share = "p_bag_feed_share";
    public static final String s_bag_feed_share = "s_bag_feed_share";
    public static final String p_bag_feed_clot = "p_bag_feed_clot";
    public static final String s_bag_feed_clot = "s_bag_feed_clot";
    public static final String p_bag_all_rec = "p_bag_all_rec";
    public static final String p_bag = "p_bag";
    public static final String p_tab = "p_tab";



    public static void clickLog(String name ,String coverid,String dataId){
        TreeMap<String,String> map = new TreeMap<>();
        map.put("type",name);
        map.put("cover_id",coverid);
        map.put("data_id",dataId);

        HttpClient.post(HttpConfig.CLICK_LOG, map, new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {

            }

            @Override
            public void onResponse(Call call, String response) {
//                String string = response.body().string();
//                ArrayList<Map<String, String>> listMapByJson = JSONUtils.getListMapByJson(string);
//                if (listMapByJson.size()>0){
//                    Map<String, String> map1 = listMapByJson.get(0);
//                    if ("200".equals(map1.get("code"))){
//                    }
//                }
            }
        });
    }

    public static void clickLog(String name ,String coverid,String dataId,String category_id){
        TreeMap<String,String> map = new TreeMap<>();
        map.put("type",name+"_"+category_id);
        map.put("cover_id",coverid);
        map.put("data_id",dataId);

        HttpClient.post(HttpConfig.CLICK_LOG, map, new Callback() {
            @Override
            public void onFailure(Call call, IOException e) {

            }

            @Override
            public void onResponse(Call call, String response) {
//                String string = response.body().string();
//                ArrayList<Map<String, String>> listMapByJson = JSONUtils.getListMapByJson(string);
//                if (listMapByJson.size()>0){
//                    Map<String, String> map1 = listMapByJson.get(0);
//                    if ("200".equals(map1.get("code"))){
//                    }
//                }
            }
        });
    }

}
